home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / gus / gmsrc211.zip / ANA.ASM next >
Assembly Source File  |  1994-03-11  |  2KB  |  71 lines

  1. proc            SetAnalyzerVolumes
  2.                 push    ax bx cx
  3.                 xor     dx,dx
  4.                 mov     ax,cx
  5.                 shl     ax,8
  6.                 mov     bx,640
  7.                 div     bx
  8.                 mov     [cs:Chan1Volume],ax
  9.                 mov     [cs:Chan2Volume],ax
  10.                 mov     [cs:Chan3Volume],ax
  11.                 mov     [cs:Chan4Volume],ax
  12.                 pop     cx bx ax
  13.                 ret
  14. endp            SetAnalyzerVolumes
  15.  
  16. proc            SpectrumAnalyzer
  17.                 push    ax bx cx dx si di
  18.                 or      ax,ax
  19.                 jz      saend
  20.                 push    ax
  21.                 xor     ch,ch
  22.                 mov     cl,[cs:si+MS.volume]
  23.                 call    SetAnalyzerVolumes
  24.                 xor     dx,dx
  25.                 mov     ax,cx
  26.                 shl     ax,8
  27.                 mov     bx,682
  28.                 div     bx
  29.                 mov     cx,ax
  30.                 mov     dx,ax
  31.                 shr     dx,1
  32.                 mov     bx,offset AnalyzerHeights
  33.                 pop     si
  34.                 sub     si,113
  35.                 mov     ax,743
  36.                 sub     ax,si
  37.                 mul     ax
  38.                 mov     si,25093
  39.                 div     si
  40.                 mov     si,ax
  41.                 cmp     si,46
  42.                 jb      saskip
  43.                 mov     si,45
  44. saskip:         shl     si,1
  45.                 add     [cs:bx+si],cx
  46.                 cmp     [Word cs:bx+si],36
  47.                 jb      saskip2
  48.                 mov     [Word cs:bx+si],36
  49. saskip2:        or      si,si
  50.                 jz      saskip3
  51.                 add     [cs:bx+si-2],dx
  52.                 cmp     [Word cs:bx+si-2],36
  53.                 jb      saskip3
  54.                 mov     [Word cs:bx+si-2],36
  55. saskip3:        cmp     si,44
  56.                 jz      saend
  57.                 add     [cs:bx+si+2],dx
  58.                 cmp     [Word cs:bx+si+2],36
  59.                 jb      saend
  60.                 mov     [Word cs:bx+si+2],36
  61. saend:          pop     di si dx cx bx ax
  62.                 ret
  63. endp            SpectrumAnalyzer
  64.  
  65. AnalyzerHeights dw      46 dup (0)
  66. Chan1Volume     dw      0
  67. Chan2Volume     dw      0
  68. Chan3Volume     dw      0
  69. Chan4Volume     dw      0
  70.  
  71.